package com.cnswhy.cloud.server.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.cnswhy.cloud.common.core.base.entity.Entity;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;
import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.cnswhy.cloud.common.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 
 * </p>
 *
 * @author cnswhy
 * @since 2021-07-05
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_customer_upgrade_trans_order")
@ApiModel(value = "CustomerUpgradeTransOrder", description = "")
@AllArgsConstructor
public class CustomerUpgradeTransOrder extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 终端编号
     */
    @ApiModelProperty(value = "终端编号")
    @TableField("menu_id")
    @Excel(name = "终端编号")
    private Long menuId;

    /**
     * 0失效 1 支付中 2 支付成功 3 已过期
     */
    @ApiModelProperty(value = "0失效 1 支付中 2 支付成功 3 已过期")
    @TableField("status")
    @Excel(name = "0失效 1 支付中 2 支付成功 3 已过期")
    private Integer status;

    /**
     * 交易金额
     */
    @ApiModelProperty(value = "交易金额")
    @TableField("trans_amt")
    @Excel(name = "交易金额")
    private Long transAmt;

    @ApiModelProperty(value = "")
    @TableField("start_day")
    @Excel(name = "", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime startDay;

    @ApiModelProperty(value = "")
    @Length(max = 255, message = "长度不能超过255")
    @TableField(value = "order_id", condition = LIKE)
    @Excel(name = "")
    private String orderId;

    @ApiModelProperty(value = "")
    @TableField("pay_type")
    @Excel(name = "")
    private Integer payType;

    /**
     * 微信用户ID
     */
    @ApiModelProperty(value = "微信用户ID")
    @Length(max = 255, message = "微信用户ID长度不能超过255")
    @TableField(value = "open_id", condition = LIKE)
    @Excel(name = "微信用户ID")
    private String openId;

    /**
     * 微信订单号
     */
    @ApiModelProperty(value = "微信订单号")
    @Length(max = 255, message = "微信订单号长度不能超过255")
    @TableField(value = "wx_order_id", condition = LIKE)
    @Excel(name = "微信订单号")
    private String wxOrderId;

    /**
     * 0 未过期 1 过期
     */
    @ApiModelProperty(value = "0 未过期 1 过期")
    @TableField("expired")
    @Excel(name = "0 未过期 1 过期")
    private Integer expired;

    /**
     * 用户ID
     */
    @ApiModelProperty(value = "用户ID")
    @TableField("customer_id")
    @Excel(name = "用户ID")
    private Long customerId;

    @ApiModelProperty(value = "")
    @TableField("end_day")
    @Excel(name = "", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime endDay;



    @TableField(exist = false)
    private Customer customer;
    @TableField(exist = false)
    private CustomerUpgradeMenu customerUpgradeMenu;

    @Builder
    public CustomerUpgradeTransOrder(Long id, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser, Long createUser, 
                    Long menuId, Integer status, Long transAmt, LocalDateTime startDay, String orderId, 
                    Integer payType, String openId, String wxOrderId, Integer expired, Long customerId, LocalDateTime endDay) {
        this.id = id;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.updateUser = updateUser;
        this.createUser = createUser;
        this.menuId = menuId;
        this.status = status;
        this.transAmt = transAmt;
        this.startDay = startDay;
        this.orderId = orderId;
        this.payType = payType;
        this.openId = openId;
        this.wxOrderId = wxOrderId;
        this.expired = expired;
        this.customerId = customerId;
        this.endDay = endDay;
    }

}
